package dyyx;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.rpc.service.EchoService;
import com.alibaba.dubbo.rpc.service.GenericService;

// 直连 不走注册中心  返化调用
public class ClientGenericMain {

	public static void main(final String[] args) {
		
		ApplicationConfig application = new ApplicationConfig();
		application.setName("dubbo-client-generic-main");
		
		ReferenceConfig<GenericService> referenceConfig = new ReferenceConfig<>();
		referenceConfig.setApplication(application);
		// referenceConfig.setInterface(HelloService.class);
		referenceConfig.setInterface("dyyx.HelloService");
		referenceConfig.setUrl("dubbo://127.0.0.1:20880");
		referenceConfig.setVersion("1.0.0");
		referenceConfig.setGroup("group1");
		referenceConfig.setGeneric(true);
		
		GenericService genericService = referenceConfig.get();
		Object result = genericService.$invoke("hello",new String[] {"java.lang.String"},new Object[] {"dyyx"});	
		System.out.println(result);


		
		
	}

}
